﻿<UserControl x:Class="BasicSkin.BalloonView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Border BorderThickness="2" CornerRadius="10" BorderBrush="LightBlue"  Background="AliceBlue">
        <DockPanel Margin="5" LastChildFill="True">
            <Image Width="32" VerticalAlignment="Center" Source="{Binding Path=ActionIcon}" DockPanel.Dock="Left">
                <Image.Style>
                    <Style TargetType="{x:Type Image}">
                        <Setter Property="Visibility" Value="Visible"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Path=ActionIcon}" Value="null">
                                <Setter Property="Visibility" Value="Collapsed"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Image.Style>
            </Image>
            <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                <TextBlock Margin="5" HorizontalAlignment="Left" FontWeight="Bold" FontSize="12" Text="{Binding Path=PrimaryText}"
                       DockPanel.Dock="Top"/>
                <TextBlock Margin="10,0,5,5" HorizontalAlignment="Left" FontSize="12" Text="{Binding Path=SecondaryText}"
                       DockPanel.Dock="Top">
                    <TextBlock.Style>
                        <Style TargetType="{x:Type TextBlock}">
                            <Setter Property="Visibility" Value="Visible"/>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding Path=SecondaryText}" Value="">
                                    <Setter Property="Visibility" Value="Collapsed"/>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </TextBlock.Style>
                </TextBlock>
            </StackPanel>
        </DockPanel>
    </Border>
</UserControl>
